<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {include file="/layout/scriptload"}
    <title>添加关键词回复</title>
</head>
<body>
<div class="box">
    <!-- /.box-header -->
    <section class="content">
        <div class="box-body">
            <form role="form">
                <div class="form-group col-md-7">
                    <label><i style="color: red;margin-right: 7px;">*</i>选择推广域名</label>
                    <select id="domain" class="form-control">
                        <option value="">请选择...</option>
                        {volist name='data' id='v'}
                        <option value="{$v.id}">{$v.domain}</option>
                        {/volist}
                    </select>
                </div>
                <div class="form-group col-md-7">
                    <label>备注</label>
                    <input type="text" id="remark" class="form-control"  placeholder="">
                </div>
                <div class="form-group col-md-7" >
                    <label><i style="color: red;margin-right: 7px;">*</i>无效跳转链接</label>
                    <input type="text" id="void_link" class="form-control"  placeholder="">
                </div>
                <div class="form-group col-md-7">
                    <label>屏蔽城市<span style="color: #f71752;">(用英文","号隔开)</span></label>
                    <input type="text" id="city" class="form-control" placeholder="">
                </div>
                <div class="form-group col-md-7" >
                    <label>安全链接</label>
                    <input type="text" id="save_link" class="form-control" placeholder="">
                </div>
                <div class="form-group col-md-7">
                    <label>是否权重</label>
                    <div class="radio">
                        <label>
                            <input type="radio" name="isweight" id="optionsRadios1" value="1" checked="">
                            随机
                        </label>
                        <label>
                            <input type="radio" name="isweight" id="optionsRadios2" value="2">
                            权重
                        </label>
                    </div>
                </div>
                <div class="form-group col-md-7">
                    <label><i style="color: red;margin-right: 7px;">*</i>选择循环方式</label>
                    <select id="xh" class="form-control">
                        <option value="不循环">不循环</option>
                        <option value="返回本身">返回本身</option>
                        <option value="使用模板">使用模板</option>
                        <option value="返回循环组">返回循环组</option>
                    </select>
                </div>
                <div class="form-group col-md-7" >
                    <div id="btn_save" class="btn bg-aqua btn-flat pull-right">保存</div>
                </div>
            </form>
        </div>
    </section>
</div>
</body>
<script>
    $(function(){
        $('#btn_save').click(function(){
            var _domain = $('#domain').val();
            var _remark = $('#remark').val();
            var _voidlink = $('#void_link').val();
            var _city = $('#city').val();
            var _save_link = $('#save_link').val();
            var _xh = $('#xh').val();
            var _weight = $('input[name="isweight"]:checked').val();
            if(_domain == ''){
                layerAlert('请选择推广的域名');
                return false;
            }
            if(_voidlink == ''){
                layerAlert('请输入无效链接');
                return false;
            }
            if(_xh == ''){
                layerAlert('请选择循环方式');
                return false;
            }
            $.ajax({
                type:'post',
                cache: false,
                url:"{:url('admin/replyfans/doAddEntryLink')}",
                data:{domain:_domain,remark:_remark,voidlink:_voidlink,city:_city,savelink:_save_link,xh:_xh,weight:_weight},
                success:function(data){
                    if(data.code==0){
                        layerAlert('添加成功',function(){
                            parent.relist();
                            layerParentClose();
                        });
                    }else{
                        layerAlert('添加失败');
                    }
                }
            })
        })
    })
</script>
</html>